def cola_supplement(stock, *args):
    """
    实现具体的逻辑并返回需要补充的可乐数量
    :param stock:
    :param args:
    :return:
    """
    # 统计每个品牌被多少客人需要
    brand_demand = {}
    for guest_prefs in args:
        for brand in guest_prefs:
            if brand in brand_demand:
                brand_demand[brand] += 1
            else:
                brand_demand[brand] = 1

    # 计算需要补充的数量
    supplement = {}
    for brand, demand in brand_demand.items():
        current = stock.get(brand, 0)
        needed = demand - current
        if needed > 0:
            supplement[brand] = needed

    return supplement


if __name__ == '__main__':
    # 初始库存
    initial_stock = {"可口可乐": 10, "百事可乐": 2, "零度可乐": 0, "芬达": 6, "健怡可乐": 4}

    # 每位客人可能喝的可乐品牌
    p1 = {"可口可乐", "零度可乐", "健怡可乐", "芬达"}
    p2 = {"百事可乐", "零度可乐", "健怡可乐"}
    p3 = {"可口可乐", "百事可乐", "芬达"}
    p4 = {"零度可乐", "芬达", "健怡可乐"}
    p5 = {"可口可乐", "百事可乐", "健怡可乐"}
    result = cola_supplement(initial_stock, p1, p2, p3, p4, p5)
    print("需要补充的可乐有：", result)  # 需要补充的可乐有： {'百事可乐': 1, '零度可乐': 3}